package cn.gok.day7;

/**
 * @ClassName Book
 * @Description TODO
 * @Author HP
 * @Date 19:06 2022/7/12
 * @Version 1.0
 * 定义类Book:int bid,String name,float price
 *  * 除了 全参数构造外，还包含 public void sell(){ //显示本书被卖了}
 *  *  private  void sell(float price,String person)://显示本书卖给了xxx，卖了 xxx元
 **/
public class Book {
    private int bid;
    private String name;
    private float price;
    public void sell(){
        System.out.println(this.name+"被卖出...");
    }
    private void sell(float price,String person){
        System.out.println(this.name+"被卖给了"+person+",卖了："+price+"元");
    }

    public Book() {
    }

    public Book(int bid, String name, float price) {
        this.bid = bid;
        this.name = name;
        this.price = price;
    }

    public int getBid() {
        return bid;
    }

    public void setBid(int bid) {
        this.bid = bid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bid=" + bid +
                ", name='" + name + '\'' +
                ", price=" + price +
                '}';
    }
}
